package io.gitee.mingbaobaba.apijson.querycondition.query.conditions;

import org.apache.commons.lang3.StringUtils;

import java.util.Collection;
import java.util.stream.Collectors;

/**
 * <p>片段拼接工具</p>
 */
final class SegmentJoiner {

    private SegmentJoiner() {
    }

    static String join(String delimiter, Collection<String> values) {
        if (values == null || values.isEmpty()) {
            return "";
        }
        return values.stream()
                .filter(StringUtils::isNotBlank)
                .collect(Collectors.joining(delimiter));
    }
}

